﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace WarehouseService
{
    
    [ServiceContract]
    public interface IWarehouseService
    {
        [OperationContract]
        Parts[] GetParts();

        [OperationContract]
        int CalculateOrderPrice(String[] parts);

        [OperationContract]
        int CalculateRepairTime(String[] parts);

        [OperationContract]
        void setQuantityPart(String name, int quantity);

        [OperationContract]
        int checkStockPart(String name);

        [OperationContract]
        void replenishStockOnCancel(String[] parts);
    }

    [DataContract]
    public class Parts
    {
        [DataMember]
        public int id { get; set; }
        [DataMember]
        public String name { get; set; }
        [DataMember]
        public int price { get; set; }
        [DataMember]
        public int quantity { get; set; }
        [DataMember]
        public int ordertime { get; set; }

        public Parts(int id, String name, int price, int quantity, int ordertime)
        {
            this.id = id;
            this.name = name;
            this.price = price;
            this.quantity = quantity;
            this.ordertime = ordertime;
        }
        public Parts()
        {
        }
    }
}
